<template>
    <ul class="navbar">
      <li class="back" @click = "$router.back()"><i class="iconfont">&#xe628;</i></li>
       <li class="title">{{ title }}</li>
       <li class="menu"><i class="iconfont">&#xe677;</i></li>
    </ul>
</template>

<script>
export default {
  name: 'Navbar',
  data () {
    return {
      title: ''
    }
  },
  watch: {
    $route: {
      handler (to) {
        this.title = to.meta?.title ?? '歌单'
      },
      immediate: true
    }
  }
}
</script>

<style scoped>
.navbar{
  list-style: none;
  display: flex;
  padding: 5px;
}
.title{
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 20px;
}
</style>
